<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

</body>
<script type="text/javascript">
    var string = 'abcdef';
    /**
     * 根据下标截取指定的字符串
     *
     * 参数1：起始下标
     * 参数2：截取的长度
     */
    var str = string.substr(1, 2);
    console.log(str, string);
</script>

</html>
